package rmi;

import graphicdisplay.FenetreJouer;

import java.awt.Graphics;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

public class ClientNotificationImpl extends UnicastRemoteObject implements
		ClientNotification {

	private FenetreJouer fa;

	public ClientNotificationImpl(
			FenetreJouer _fa
			) throws RemoteException {
		super();
		fa = _fa;
	}
	
	public FenetreJouer getFa() {
		return fa;
	}

	public void setFa(FenetreJouer fa) {
		this.fa = fa;
	}

	@Override
	public void notifyMessage(String message) throws RemoteException {
		fa.afficheTextarea(message);
	}

	public void notifyLife(int life) throws RemoteException {
		fa.maj_Vie_actu(life);
	}

	@Override
	public void notifyDeath() throws RemoteException {
		// creer la popup de mort
		fa.afficher_gameover();
	}

	@Override
	public void notifyRoom(Integer idroom) throws RemoteException {
		// fa.majRoom(false);
		fa.getCli1().getMyCharacter().currentRoom.setIdroom(idroom);		
	}

	@Override
	public void notifyLifeMax(int life_max) throws RemoteException {
		// TODO Auto-generated method stub
		fa.maj_Vie_max(life_max);
	}
	
	@Override
	public void notifyArmor(int armor) throws RemoteException {
		// TODO Auto-generated method stub
		fa.maj_armor(armor);
	}

	
	@Override
	public void notifyDamage(int damage) throws RemoteException {
		// TODO Auto-generated method stub
		fa.maj_damage(damage);
	}


	@Override
	public void notifyEntered_repaint() throws RemoteException {
		fa.clear_salle();
	}

	@Override
	public void majRoom() throws RemoteException {
		fa.majRoom(false);
	}

	@Override
	public void reload() throws RemoteException {
		fa.majRoom(false);
	}

}
